package hfjava;

public class Books_1 {
    private int bookld;
    private String bookName;
    private String authorName;
    private String press;
    private double price;

    //方法

    public Books_1(int bookld, String name, String press,double price) {
        this.bookld = bookld;
        this.bookName = name;
        this.press = press;
        setPrice(price);
    }
    public String getAuthorName(){
        return "牛哥";
    }
    public void setPrice(double price){
        if (price>10){
            this.price=price;
        }else{
            this.price=0;
        }
    }
    public double getPrice(){
        return price;
    }
    public void shoeInfo(){
        System.out.println(bookName+"编号为："+bookld+"\t 作者是:"+getAuthorName()+"\t出版社为："+press+"\t价格为："+price);
    }

    public static void main(String[] args) {
        Books_1 book=new Books_1(1,"白雪公主","新华出版社",23.0);
        book.shoeInfo();
    }
}
